package com.mg.controller;

import com.github.pagehelper.PageInfo;
import com.mg.dto.SimpleResult;
import com.mg.model.MachineType;
import com.mg.service.MachineTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by mg1213 on 2018/3/18.
 */
@Controller
@RequestMapping("/machineType")
public class MachineTypeController {
    @Autowired
    private MachineTypeService machineTypeService;

    @RequestMapping(value = "/admin/selectPageInfo")
    @ResponseBody
    public PageInfo<MachineType> selectPageInfo(MachineType dto, int limit, int start) {
        return machineTypeService.selectPageInfo(dto, start, limit);
    }
    @RequestMapping(value = "/admin/insertMachineType")
    @ResponseBody
    public SimpleResult insertMachineType(MachineType record) {
        return machineTypeService.insertMachineType(record);
    }
    @RequestMapping(value = "/admin/updateMachineType")
    @ResponseBody
    public SimpleResult updateMachineType(MachineType record) {

        return  machineTypeService.updateMachineType(record);
    }
    @RequestMapping(value = "/admin/deleteMachineType")
    @ResponseBody
    public SimpleResult deleteMachineType(String ids) {
        return machineTypeService.deleteMachineType(ids);
    }

}
